package common;

public class UTF8HexTester {
        public static void main(String[] args) {
            String s;
            s = "\uD840\uDE0C";
            System.out.println("the hex of “" + s + "” : " + UTF8Utils.bytesToHex(s.getBytes()));


            String s2= "the hex of :"+"\uD840\uDE0CAn \uD83D\uDE00awesome \uD83D\uDE03string \uD83D\uDE04with a few \uD83D\uDE09emojis!";
            System.out.println(s2);
            //16
            String s3= UTF8Utils.bytesToHex(s2.getBytes());
            System.out.println(s3);

            System.out.println("=======================================");

            System.out.println(UTF8Utils.contains4BytesChar2(s));
            System.out.println(UTF8Utils.contains4BytesChar2(s2));
            System.out.println(UTF8Utils.contains4BytesChar(s3));

            System.out.println("替换后-----------");
            System.out.println(s2);
            String s4 = new String(UTF8Utils.remove4BytesUTF8Char(s2));
            System.out.println(s4);

            System.out.println("===------");
            System.out.println(UTF8Utils.bytesToHex("*".getBytes()));
        }
}

